#ifndef CPHOTONMAPPING_H
#define CPHOTONMAPPING_H

class CRaytracer;

#include "cray.h"
#include "craytracer.h"
#include "cphotonmap.h"
#include "cvecteur3f.h"
#include "cpoint3f.h"
#include "cmaterial.h"

struct photonMapSettings {
	enum
	{
		conicEstimator,
		gaussianEstimator,
		radianceEstimator
	}
	eFilterType;
	int size;
	bool directLighting;
	int maxNearestPhotons;
	float maxDistanceSquare;
};

class CPhotonMapping
{
public:
	CPhotonMapping(int nb_photons, bool directLighting, int MaxNearPhoton, int MaxDistSquare);

	bool calcPhotonMap(CRaytracer *myScene, int nb_reflects);

	bool addPhotonRay(CRay viewRay, CRaytracer *myScene, CPhotonMap & myPhotonMap);

	bool photonTraceChannelRec (CRay Ray, unsigned nb_reflects, CRaytracer * myScene, int channel);

	CPhotonMap photonmap[3];
	photonMapSettings phMapProp;
};

#endif // CPHOTONMAPPING_H
